package com.hyperboost.utils;

@SuppressWarnings("all")
public class ThreadLocalUtil {
    //提供ThreadLocal对象,
    private static final ThreadLocal THREAD_LOCAL = new ThreadLocal();

    /**
     * 获取ThreadLocal中的值
     * @return
     * @param <T>
     */
    public static <T> T get(){
        return (T) THREAD_LOCAL.get();
    }
	
    /**
     * 存储ThreadLocal中的值
     * @param value
     */
    public static void set(Object value){
        THREAD_LOCAL.set(value);
    }

    /**
     * 清除ThreadLocal中的值防止内存泄漏
     */
    public static void remove(){
        THREAD_LOCAL.remove();
    }
}
